using UnityEngine;

public class AchivementUIButton : MonoBehaviour
{
	public UILabel passLabel;

	public UILabel title;

	public UILabel text;

	private AchivementsLayer achivementsLayer;

	private GGStoryAchivementBase storyAchivement;

	public void Init(GGStoryAchivementBase achivement, AchivementsLayer achivementsLayer, int index)
	{
		storyAchivement = achivement;
		this.achivementsLayer = achivementsLayer;
		title.text = index + 1 + " " + achivement.name;
		text.text = achivement.GetDescription();
		passLabel.cachedGameObject.SetActive(achivement.isFinished());
	}

	public void OnClick()
	{
		achivementsLayer.story.ShowWithAchivement(storyAchivement, true);
	}
}
